file = open('./page_index.txt')
page_index_txt = file.read()
index = eval(page_index_txt)

file = open('./web_graph.txt')
graph_txt = file.read()
graph = eval(graph_txt)
file.close()

page_index={}
web_grapgh={}
id=19
for page in index.keys():
    outlinks = graph[page]
    for outlink in outlinks:
        column_number = index.get(outlink, None)
        if column_number is None:
            print('None')
            id=id+1
            page_index={outlink:id}
            web_graph={outlink:[]}
            with open('./page_index.txt', 'a') as pfile:
                pfile.write(page_index.__str__().replace('{', ',').replace('}', ''))
            with open('./web_graph.txt', 'a') as wfile:
                wfile.write(web_graph.__str__().replace('{', ',').replace('}', ''))